package com.autosalon.model;

import java.io.Serializable;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "VYROBCE")
public class Vyrobce implements Serializable, IModelClass{

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;
	
	@Column(name = "NAZEV_VYROBCE", length = 50, nullable=false)
	private String nazev_vyrobce;
	
	@OneToMany(cascade = CascadeType.ALL)
	@JoinColumn(name = "ID_VYROBCE")
	private List<Model> modely;

	@Override
	public Long getId() {
		return id;
	}

	public String getNazev_vyrobce() {
		return nazev_vyrobce;
	}

	public void setNazev_vyrobce(String nazev_vyrobce) {
		this.nazev_vyrobce = nazev_vyrobce;
	}

	public List<Model> getModely() {
		return modely;
	}

	public void setModely(List<Model> modely) {
		this.modely = modely;
	}
	
	
}
